integrating both directions